using System;
using System.Net;
using System.Text;
using System.Net.Sockets;

class MainClass
{
	static void Main(string[] args)
  	{
   		String Server = "127.0.0.1";
		int port = 7;
		byte[] sendPacket = Encoding.ASCII.GetBytes("Hallo Echo!!");
		UdpClient client = new UdpClient();
		try
		{
			client.Send(sendPacket, sendPacket.Length, Server, port);
			IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any,0);
			byte[] rcvEcho = client.Receive(ref remoteEndPoint);
			System.Console.WriteLine(Encoding.ASCII.GetString(rcvEcho,0,rcvEcho.Length ));
		}
		catch (SocketException se)
		{
			System.Console.WriteLine(se);
		}
		client.Close();
    }
}